Skip to content

Conversation

@Venefilyn
Copy link
Member

This replaces logging with their best counterpart. Either normal logging
methods with arguments, or by utilizing .format()

Depends on #1431

max_nvra_length = max(len(nvra) for nvra in package_info)

header = (
"%-*s %-*s %s"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've got this from Grok AI since it's been long since I wrote that code:

%-*s in print("%-*s" % (width, "text")) is a format specifier where:
   * means the width of the field is given by the first argument in the tuple (width in this case).
   - means left-align the text within that width.
   s means it's formatting a string.```

The format() replacement would look like print("{:<{}}".format("text", width)).

{:<{}} means:
  < aligns the text to the left.
  {} specifies the field width.```

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I checked on my own using https://pyformat.info/ and found a solution that looks a bit better

@Venefilyn Venefilyn force-pushed the chore/percent-strings branch from bf0c24f to d78a11d Compare January 16, 2025 13:30
@codecov
Copy link

codecov bot commented Jan 16, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 96.11%. Comparing base (ee552d2) to head (a5d59e8).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1448   +/-   ##
=======================================
  Coverage   96.11%   96.11%           
=======================================
  Files          72       72           
  Lines        5176     5176           
  Branches      895      895           
=======================================
  Hits         4975     4975           
  Misses        119      119           
  Partials       82       82           
Flag Coverage Δ
centos-linux-7 91.63% <75.00%> (ø)
centos-linux-8 92.49% <100.00%> (ø)
centos-linux-9 92.61% <100.00%> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@Venefilyn Venefilyn requested a review from bocekm January 20, 2025 12:53
@Venefilyn Venefilyn added skip/changelog If it should be excluded from changelog or Release notes. Such as infra, reverted PRs, etc. tests/sanity PR ready to run the sanity test suit. Equivalent to `/packit test --labels sanity`. kind/refactor labels Jan 20, 2025
@has-bot
Copy link
Member

has-bot commented Jan 20, 2025

/packit test --labels sanity


Comment generated by an automation.

@Venefilyn
Copy link
Member Author

/packit test --labels sanity

1 similar comment
@Venefilyn
Copy link
Member Author

/packit test --labels sanity

@danmyway
Copy link
Member

/packit retest-failed

@bocekm
Copy link
Member

bocekm commented Apr 23, 2025

/packit build

@bocekm bocekm force-pushed the chore/percent-strings branch from d78a11d to f11ae9b Compare April 23, 2025 21:16
@bocekm bocekm added tests/sanity PR ready to run the sanity test suit. Equivalent to `/packit test --labels sanity`. and removed tests/sanity PR ready to run the sanity test suit. Equivalent to `/packit test --labels sanity`. labels Apr 23, 2025
@has-bot
Copy link
Member

has-bot commented Apr 23, 2025

/packit test --labels sanity


Comment generated by an automation.

pre-commit-ci bot and others added 3 commits April 24, 2025 15:47
updates:
- [github.com/astral-sh/ruff-pre-commit: v0.7.3 → v0.8.2](astral-sh/ruff-pre-commit@v0.7.3...v0.8.2)
- [github.com/teemtee/tmt.git: 1.38.0 → 1.39.0](https://github.com/teemtee/tmt.git/compare/1.38.0...1.39.0)
- [github.com/jendrikseipp/vulture: v2.13 → v2.14](jendrikseipp/vulture@v2.13...v2.14)
This replaces logging with their best counterpart. Either normal logging
methods with arguments, or by utilizing `.format()`
This changes `%-*s %-*s %s` %-string to their format counterpart
`%-*s` = left-padded with next %-parameter indicating substring length
or precision length.
@bocekm bocekm force-pushed the chore/percent-strings branch from f11ae9b to a5d59e8 Compare April 24, 2025 13:47
@bocekm
Copy link
Member

bocekm commented Apr 24, 2025

/packit test --labels sanity

2 similar comments
@bocekm
Copy link
Member

bocekm commented Apr 24, 2025

/packit test --labels sanity

@bocekm
Copy link
Member

bocekm commented Apr 29, 2025

/packit test --labels sanity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

kind/refactor skip/changelog If it should be excluded from changelog or Release notes. Such as infra, reverted PRs, etc. tests/sanity PR ready to run the sanity test suit. Equivalent to `/packit test --labels sanity`.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants